from timeit import Timer

import sys
import math


def Problem():
    """The prime factors of 13195 are 5, 7, 13 and 29.

    What is the largest prime factor of the number 600851475143?"""


    # LCM
    n = 600851475143
    sqn = int(math.floor(n ** 0.5))
    fac = [1]
    
    for x in range(2, sqn+1):
        if n % x == 0:
            fac.append(x)
            n = n/x
        if n == 1:
            break

    print fac

    print "Answer for Problem 3 = %d" % (fac.pop(),)




    
if __name__ == "__main__":
    t = Timer(setup='from __main__ import Problem', stmt='Problem()').timeit(1)
    print "Execution time = %0.3f seconds" %(t,)